Skip to content

Enable clickable file path links in message markdown#62

Closed
Dimillian wants to merge 1 commit intomainfrom
codex/github-mention-codexmonitor-does-not-open-file-links-paths
Closed

Enable clickable file path links in message markdown#62
Dimillian wants to merge 1 commit intomainfrom
codex/github-mention-codexmonitor-does-not-open-file-links-paths

Conversation

@Dimillian
Copy link
Owner

Motivation

  • Messages displayed file paths as plain highlighted text but did not allow opening files or revealing them in Finder; users should be able to click a path to open it.
  • Relative paths in messages should resolve against the active workspace so opener actions work from the correct project root.

Description

  • Add a remark plugin remarkFileLinks and utility fileLinks to detect file-path-like text in markdown and emit codex-file: links instead of plain text.
  • Extend the Markdown component to register the plugin and a custom anchor renderer that intercepts codex-file: links and calls a provided onOpenFileLink callback.
  • Introduce useFileLinkOpener hook to resolve relative paths with @tauri-apps/api/path.resolve and open files using @tauri-apps/plugin-opener.openPath (ignoring opener failures to avoid breaking rendering).
  • Wire the new hook into Messages by passing the active workspace path from useLayoutNodes so message-rendered links open relative to the current workspace, and add the new dependency unist-util-visit to support the remark transform.

Testing

  • No automated test suite was executed for this change; no unit or E2E tests were run.
  • The new dependency was installed via npm install unist-util-visit@^5.0.0 which completed successfully.

Codex Task

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant